package com.itheima.state;

public class Demo01 {


    public static void main(String[] args) throws InterruptedException {

        Thread t1 = new Thread(() -> {
            Thread thread = Thread.currentThread();

            System.out.println("循环睡前的状态"+thread.getState());

            for (int i = 0; i < 10; i++) {
                try {
                    Thread.sleep(100);
                    System.out.println("循环中睡后的状态"+thread.getState());

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }


        });
        System.out.println(t1.getState());
        t1.start();
        System.out.println(t1.getState());



        Thread.sleep(3000);
        System.out.println(t1.getState());

    }
}
